<html>
<head>
<title>Bit Adder</title>
</head>

<body bgcolor="FFFFFF">

<h1><img align="center" height="32" width="32" src="../../../icons/bitadder.gif">
<em>Bit Adder</em></h1>

<p><table>
<tr><td><strong>Library:</strong></td>
	<td><a href="index.html">Arithmetic</a></td></tr>
<tr><td><strong>Introduced:</strong></td>
	<td>2.6.0</td></tr>
<tr><td valign="top"><strong>Appearance:</strong></td>
	<td valign="top"><img src="../../../img-libs/bitadder.png"></td></tr>
</table></p>

<h2>Behavior</h2>

<p>The component determines how many 1 bits are in its input(s) and emits the
total number of 1 bits on its output. For example, given the 8-bit input 10011101,
the output would be 5, since there are five 1-bits in the input
(the first, the last, and a string of three bits in the middle).</p>

<p>If any of the input bits are floating or error values, then the output will
contain error bits in the output corresponding to the range of possible outputs
depending on whether those floating/error values are counted as zeroes or ones.
For instance, if the 14-bit input is 111x10110x1101, then the output must be
at least 9 (if the x's are interpreted as zeroes)
and at most 11 (if they are interpreted as ones).
Thus, the output will be 10EE: The upper two bits will be 1 and 0 since all integers
between 9 and 11 have 1 and 0 as their top two bits, but the lower two bits are EE
since integers between 9 and 11 vary within these bits.</p> 

<h2>Pins</h2>

<dl>

<dt>West edge (inputs, bit width matches Data Bits attribute)</dt>
<dd>The inputs whose 1 bits are to be counted. The number of inputs is based
on the Number of Inputs attribute.</dd>

<dt>East edge (output, bit width computed as described below)</dt>
<dd>The number of input bits which are 1. The bit width of the output is the
minimum number of bits to store the maximum possible value (which would be
the product of the Data Bits attribute and the Number of Inputs attribute).</dd>

</dl>

<h2>Attributes</h2>

<p>When the component is selected or being added,
the digits '0' through '9' alter its <q>Number of Inputs</q> attribute and
Alt-0 through Alt-9 alter its <q>Data Bits</q> attribute.</p>

<dl>

<dt>Data Bits</dt>
<dd>The bit width of the input(s).</dd>

<dt>Number of Inputs</dt>
<dd>The number of input values.</dd>

</dl>

<h2>Poke Tool Behavior</h2>

<p>None.</p>

<h2>Text Tool Behavior</h2>

<p>None.</p>

<p><a href="../index.html">Back to <em>Library Reference</em></a></p>

</body>
</html>
